/*
 * protocol_meter.h
 *
 *  Created on: 2018-3-31
 *      Author: root
 */

#ifndef PROTOCOL_METER_H_
#define PROTOCOL_METER_H_
#ifdef __cplusplus
extern "C"{
#endif
#include "share_type.h"
#include "meter_com.h"

typedef enum
{
   A,
   B,
   C,
}PHASE;


typedef int			(*SendDataMain)(u8 gunid,void* pdata);	//命令处理函数指针
//md_meter)(cmdstr *);	//命令处理函数指针
typedef int			(*SendErrToMain)(u8 gunid,u8 errFlag);	//命令处理函数指针


typedef struct
{
	int devtype; //1:dc, 2:ac
	int hardware_ver;//硬件版本
	unsigned char meternum;
	unsigned char portnum;
	unsigned int in_baud;//波特率

    char        in_phase_num;
	unsigned int out_baud;//波特率
    SendDataMain     sendData; //命令处理函数指针
    SendErrToMain        sendErr;
    callbackFun_log writelog;
    Meter_Info* pmeter_para;

}uart_meter;

int protocol_meter_init(void * pmeter); //返回0成功，1 失败

#ifdef __cplusplus

}

#endif
#endif /* PROTOCOL_METER_H_ */
